package com.cabrida.livestar.util;

import android.graphics.Bitmap;

import com.cabrida.livestar.R;
import com.caishuij.image.core.DisplayImageOptions;
import com.caishuij.image.core.assist.ImageScaleType;
import com.caishuij.image.core.display.SimpleBitmapDisplayer;

public class OptionImageUtil {
	public static DisplayImageOptions getDelfaultOption() {
		DisplayImageOptions options = new DisplayImageOptions.Builder()
				// .showStubImage(R.drawable.course_default)
				// .showImageForEmptyUri(R.drawable.course_default)
				.showImageOnFail(R.drawable.ic_launcher)
				.resetViewBeforeLoading(false).cacheOnDisk(true)
				.cacheInMemory(true).imageScaleType(ImageScaleType.EXACTLY)
				.bitmapConfig(Bitmap.Config.RGB_565)
				.displayer(new SimpleBitmapDisplayer()).build();

		return options;

	}

	public static DisplayImageOptions getPersonIcon() {
		@SuppressWarnings("deprecation")
		DisplayImageOptions options = new DisplayImageOptions.Builder()
				// .showStubImage(R.drawable.user_default_icon)
				// .showImageForEmptyUri(R.drawable.user_default_icon)
				.showImageOnFail(R.drawable.ic_launcher)
				.resetViewBeforeLoading(false).cacheOnDisc(true)
				.imageScaleType(ImageScaleType.EXACTLY)
				.bitmapConfig(Bitmap.Config.RGB_565)
				.displayer(new SimpleBitmapDisplayer()).build();
		return options;
	}

}
